package com.citybox.infrastructure.user.persistence.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.citybox.domain.user.UserDo;
import com.citybox.infrastructure.user.dataobject.User;
import org.apache.ibatis.annotations.*;

/**
 * @author zhao.x
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("SELECT * FROM t_user WHERE id = #{id}")
    UserDo getById(@Param("id") String id);


    @Select("SELECT " +
            "id, nick_name, is_real_auth, union_id, open_id, " +
            "address_code, address_name, state, credit_score, " +
            "latitude, longitude, is_delete " +
            "FROM t_user " +
            "WHERE union_id = #{unionId} AND open_id = #{openId}")
    UserDo getUserByUserDo(@Param("unionId") String unionId,@Param("openId") String openId);
}
